package me.zk;

import com.google.common.base.Joiner;
import org.springframework.context.ApplicationEvent;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;

/**
 * @Author: zhang kai
 * @Date: 2021/09/18
 * @Description:
 */
public class App {
    public static void main(String[] args) throws ParseException {
//        ExpressionParser parser = new SpelExpressionParser();
//        Expression expression = parser.parseExpression("'Hello World'.concat('1')");
//        System.out.println((String) expression.getValue());
//        Expression exp = parser.parseExpression("'Hello World'.bytes.length");
//        System.out.println((Integer) exp.getValue());
//        Converter<Integer,String> c = (param)->System.out.println(String.valueOf(param + 1));
//        c.covert1(23);
//
//        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMM", Locale.SIMPLIFIED_CHINESE);
//        Date parse = dateFormat.parse("202302");
//        System.out.println();
        Map<String, Object> map = new TreeMap<String,Object>();
        map.put("logicId", "logicId()");
        map.put("cardType", "tripRecentForm.getCardType()");
        map.put("traTime", "tripRecentForm.getTraTime()");
        map.put("deviceId", "tripRecentForm.getDeviceId()");
        map.put("traStation", "tripRecentForm.getTraStation()");
        map.put("version", "tripRecentForm.getVersion()");


        //1.Guava
        String content1 = Joiner.on("&").withKeyValueSeparator("=").join(map);
        System.out.println("content1:"+content1);


    }
    @FunctionalInterface
  interface Converter<T1, T2>{
        void covert1(int i);
  }
}
